{% extends 'index.html' %}
{% load custom_tags %}    #导入simpletag文件

{% block page-left %}
    <div class="article">
        <h2>{{ article_obj.title }}</h2>
        <hr/>
        <p>{{ article_obj.content |safe }}</p>
        <hr/>
{#      通过文章表反向去查有多少评论,得到一个包含评论对象的列表，传给simpletag函数build_comment_tree函数处理  #}
{#        返回拼接好的html  #}
{% autoescape off %}
    {% comment_list_to_dic article_obj.comment_set.select_related %}
{% endautoescape %}
    </div>

{% endblock %}

{% block page-right %}
    <div class="article-right">
        <button type="button" class="btn btn-default">
            <a href="{% url 'publish' %}"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+发&nbsp;&nbsp;布&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
        </button>
    </div>
{% endblock %}

